Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 3 - Image Compression Manager / Image Compression Manager Reference
Image Compression Manager Functions


Constraining Compressed Data

The Image Compression Manager provides two functions and a data structure that allow your application to communicate information to compressors that can constrain compressed data to a specific data rate. Compressors indicate that they can constrain the data rate by setting the following flag in their compressor information structure:

#define codecInfoDoesRateConstrain(1L<<23)
(For details, see "The Compressor Information Structure" beginning on page 3-52.)

The DataRateParams data type defines the data rate parameters structure.

typedef struct {
   long     dataRate;               /* bytes per second */
   long     dataOverrun;            /* number of bytes outside
                                       rate */
   long     frameDuration;          /* in milliseconds */
   long     keyFrameRate;           /* frequency of key frames */
   CodecQ   minSpatialQuality;      /* minimum spatial quality */
   CodecQ   minTemporalQuality;     /* minimum temporal quality */
} DataRateParams;
typedef DataRateParams *DataRateParamsPtr;
Field Description
dataRate
Specifies the bytes per second to which the data rate must be constrained.
dataOverrun
Indicates the current number of bytes above or below the desired data rate. A value of 0 means that the data rate is being met exactly. If your application doesn't know the data overrun, it should set this field to 0.
frameDuration
Specifies the duration of the current frame in milliseconds.
keyFrameRate
Indicates the frequency of key frames. This frequency is normally identical to the key frame rate passed to the CompressSequenceBegin function (described on page 3-100).
minSpatialQuality

Specifies the minimum spatial quality the compressor should use to meet the requested data rate. See "Compression Quality Constants" beginning on page 3-57 for available values.
minTemporalQuality

Indicates the minimum temporal quality the compressor should use to meet the requested data rate. See "Compression Quality Constants" beginning on page 3-57 for available values.
The SetCSequenceDataRateParams function allows you to specify the parameters in this structure and the GetCSequenceDataRateParams function allows you to retrieve the parameters.


Subtopics
SetCSequenceDataRateParams
GetCSequenceDataRateParams

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996